import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
const list = {
	listing:[]
}

//城市选择页面
const city = {
	citying:""
}

//发表页面跳转仓库
const travecity ={
	traveing:''
}

//发表成功页面不跟新所以传值给vuex让computed属性监听
const roturn ={
	pagesis:false
	
}

//点击nav标签的值
const navs = {
	naving:'recomment'
}

//要传到购物车的值
const getdatas ={
	getdataing:''
}
const state = {
	list,
	city,
	travecity,
	roturn,
	navs,
	getdatas
}
export default new Vuex.Store({
	state,
	actions:{
		listact(listact,listdata){
			// console.log(listdata)
			listact.commit('listmut',listdata)
		}
	},
	mutations:{
		listmut(state,listdata){
			console.log(listdata)
			state.list = {
				listing:listdata
			}
		},
		//city城市页面跳转仓库
		citymuta(state,cityion){
			console.log("city仓库值：",cityion)
			state.city={
				citying:cityion
			}
			
		},
		
		//发表页面跳转仓库
		travemuta(state,cityion){
			console.log("发表仓库值：",cityion)
			state.travecity={
				traveing:cityion
			}
			
		},
		
		//发表成功页面不跟新所以传值给vuex让computed属性监听
		roturnMuta(state,pagesis){
			state.roturn={
				pagesis:pagesis
			}
		},
		//切换nav值
		navmit(state,nav){
			console.log("发表仓库值：",nav)
			state.navs={
				naving:nav
			}
		},
		//要传到购物车的值
		getdMit(state,getdata){
			console.log("发表仓库值：",getdata)
			state.getdatas={
				getdataing:getdata
			}
		}
	}
})